/*************************************************************************
	> File Name: P1176.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-02-10 16:16:32
 ************************************************************************/
#include <iostream>
using namespace std;

#define MAX_N 1000
int f[MAX_N + 5][MAX_N + 5];
bool flag[MAX_N + 5][MAX_N + 5];
const int mod = 100003;

int main() {
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int x, y;
        scanf("%d%d", &x, &y);
        flag[x][y] = true;
    }
    f[1][1] = 1;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            if (i == 1 && j == 1) continue;
            if (flag[i][j]) {
                f[i][j] = 0;
                continue;
            }
            f[i][j] = (f[i - 1][j] + f[i][j - 1]) % mod;
        }
    }
    cout << f[n][n] << endl;
    return 0;
}
